<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName()
			+ ":" + request.getServerPort() + request.getContextPath();
%>
<jsp:include page="/WEB-INF/page/auth/_header.jsp"></jsp:include>
<body>
	<jsp:include page="/WEB-INF/page/auth/header.jsp"></jsp:include>
	<div id="middle">
		<jsp:include page="/WEB-INF/page/auth/menu.jsp"></jsp:include>
		<div id="right">
		    <div id="teacher_fruit_regtb">
		        <form id="teacher_fruit_regForm" class="p10">
		            学期：
		            <select class="form-control1" name="termId" id="termId"></select>
		            类别：
		            <select class="form-control1" name="fruitType" id="fruitType"></select>
		            教师姓名：
		            <input class="form-control1" name="teacherName" id="teacherName">
					<input type="hidden" id="schoolId" name="schoolId" value=""/>
		            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm('teacher_fruit_reg')">查询</a>
		            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-clear'" onclick="resetForm('teacher_fruit_reg')">重置</a><br/>
		        </form>
		    </div>
		    <table id="teacher_fruit_regdg">
		        <thead>
		            <tr>
		                <th data-options="field:'ID',checkbox:true">ID</th>
		                <th data-options="field:'termId',title:'学期名称',editor:{
		                    type:'combobox',
		                    options:{
		                        editable:false,
		                        panelHeight:'auto',
		                        required:true,
		                        valueField:'id',
		                        textField:'termName',
		                        url:'<%=basePath %>/common/termList'
		                    }
		                },formatter:function(value,row,index){
		                    return row.termName;
		                }"></th>
		                <th data-options="field:'fruitType',title:'类别',editor:{
		                    type:'combobox',
		                    options:{
		                        editable:false,
		                        required:true,
		                        url:'<%=basePath %>/common/getFruitParam/类别',
		                        method: 'GET'
		                    }}"></th>
		                <th data-options="field:'projectName',title:'项目名称',editor:{
		                    type:'textbox',options:{required:true}},formatter: function(value, row, index) {
		                        return '<span class=\'note\' title=\''+value+'\'>'+ value + '</span>';
		                    }"></th>
		                <th data-options="field:'projectContent',title:'项目内容',editor:{type:'textbox'},
		                formatter: function(value, row, index) {
		                    return '<span class=\'note\' title=\''+value+'\'>'+ value + '</span>';
		                }"></th>
		                <th data-options="field:'teacherId',title:'教师姓名',editor:{
		                    type:'combobox',
		                    options:{
		                        valueField:'id',
		                        textField:'name',
		                        method:'POST',
		                        url: '<%=basePath %>/common/teacherList',
		                        required:true
		                    }
		                },formatter:function(value,row,index){
		                    return row.teacherName;
		                }"></th>
		                <th data-options="field:'awardLevel',title:'获奖级别',editor:{
		                    type:'combobox',
		                    options:{
		                        editable:false,
		                        url:'<%=basePath %>/common/getFruitParam/获奖级别',
		                        method:'GET',
		                        required:true
		                    }}"></th>
		                <th data-options="field:'awardGrade',title:'获奖等第',editor:{
		                    type:'combobox',
		                    options:{
		                        editable:false,
		                        url:'<%=basePath %>/common/getFruitParam/获奖等第',
		                        method: 'GET',
		                        required:true
		                    }}"></th>
		                <th data-options="field:'awardDate',title:'获奖时间',editor:{
		                    type:'datebox',options:{required:true}}"></th>
		                <th data-options="field:'awardCompany',title:'颁发单位',editor:{
		                    type:'textbox'}"></th>
		                <th data-options="field:'remark',title:'备注',editor:{
		                    type:'textbox'},
		                formatter: function(value, row, index) {
		                    return '<span class=\'note\' title=\''+value+'\'>'+ value + '</span>';
		                }"></th>
		            </tr>
		        </thead>
		    </table>
		</div>
	</div>
	<jsp:include page="/WEB-INF/page/auth/_footer.jsp"/>
	<script type="text/javascript">
        $(function(){
			initSchoolIdInputValue();
        	var url = basePath + "/sys/teacherFruit/reg";
        	var schoolId = $("#userSchoolId").val();
            initDatagridAdmin("teacher_fruit_reg",url,1,1,1,1,1);
            termList("teacher_fruit_reg");
            getFruitParam("teacher_fruit_reg","fruitType","类别");
        });
		function initSchoolIdInputValue() {
			var value1 = $("#userSchoolId").val();
			$("#schoolId").val(value1);
		}
    </script>
</body>
</html>